x86: adjust MSR_IA32_MISC_ENABLE handling
authorKeir Fraser <keir@xen.org>
Fri, 24 Sep 2010 14:54:39 +0000 (15:54 +0100)
committerKeir Fraser <keir@xen.org>
Fri, 24 Sep 2010 14:54:39 +0000 (15:54 +0100)
commit3527a9f3a8b76950ecb05c005dc6d4290b7bbf93
treeeb811c4c20f05e2ee4b65713c55475df9d24e5d3
parent1505df1590339e4ff0b4b28c9df2205f6ee4b4e7
x86: adjust MSR_IA32_MISC_ENABLE handling

In the warning message issued on writes, the Xen-modified value should
be printed (and used to determine whether anything needs to be printed
at all), as the guest kernel will usually do a read-modify-write
cycle.

A question is whether Dom0 shouldn't be allowed control over some
bits, or whether some bits shouldn't be fully virtualized. I'm
particularly thinking of MSR_IA32_MISC_ENABLE_FAST_STRING, which
recent Linux kernels want to disable for CONFIG_KMEMCHECK.

While putting this together I also noticed that rdmsr_safe() failed to
initialize its output registers in the failure path, thus leading to
printing of uninitialized data in the guest WRMSR warning message.

Further, the default case value-changed check can be simplified.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen/arch/x86/traps.c
xen/include/asm-x86/msr.h